﻿package view.prompt
{
    import com.core.*;
    import com.greensock.*;
    import com.greensock.easing.*;
    import flash.events.*;

    public class TeamPrompt extends ButtonPromptCell
    {
        private var teamMsg:Array;
        private var tweenMax:TweenMax;
        private var _msg:Object;

        public function TeamPrompt()
        {
            return;
        }// end function

        override public function show(param1:Object) : void
        {
            super.show(param1);
            this.teamMsg = ModelProxy.getValue("team", "inviteteam");
            if (this.teamMsg == null)
            {
                this.teamMsg = [];
                ModelProxy.change("team", "inviteteam", this.teamMsg);
            }
            this._msg = param1;
            this.teamMsg.push(this._msg);
            btn.x = 8;
            btn.y = 5;
            if (this.tweenMax == null)
            {
                this.alpha = 1;
                this.tweenMax = TweenMax.to(this, 0.6, {alpha:0, yoyo:true, repeat:int.MAX_VALUE, ease:Sine.easeIn});
            }
            return;
        }// end function

        override protected function doMouse(event:MouseEvent) : void
        {
            ModelProxy.change("team", "inviteteam", this.teamMsg);
            ModelProxy.change("plugin", "open", {target:"inviteteam"});
            super.doMouse(event);
            return;
        }// end function

        override public function hide() : void
        {
            super.hide();
            if (this.tweenMax == null)
            {
                this.alpha = 1;
                this.tweenMax = TweenMax.to(this, 0.6, {alpha:0, yoyo:true, repeat:int.MAX_VALUE, ease:Sine.easeIn});
            }
            return;
        }// end function

    }
}
